#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

#define MAX_LEN 1000

//从小到大排序
void ptr_sort(int a[], int len)
{
    for (int* p = (a + len - 1); p > a; --p) {
        for (int *q = a; q < p; ++q) {
            if (*q > *(q + 1)) {
                int t = *q;
                *q = *(q + 1);
                *(q + 1) = t; 
            }
        }
    }
}